import request from '@/utils/request'

// 查询服务项列表
export function listServiceItem(query) {
  return request({
    url: '/workflow/serviceItem/list',
    method: 'get',
    params: query
  })
}

// 查询服务项详细
export function getServiceItem(id) {
  return request({
    url: '/workflow/serviceItem/' + id,
    method: 'get'
  })
}

// 新增服务项
export function addServiceItem(data) {
  return request({
    url: '/workflow/serviceItem',
    method: 'post',
    data: data
  })
}

// 修改服务项
export function updateServiceItem(data) {
  return request({
    url: '/workflow/serviceItem',
    method: 'put',
    data: data
  })
}

// 发起审核服务套餐项
export function startPackageAudit(data){
  return request({
    url: '/workflow/serviceItem/startAudit',
    method: 'post',
    data
  })
}

//上架服务项
export function saleOn(id){
 return request({
  url: '/workflow/serviceItem/saleOn/'+id,
  method: 'put'
 })
}

//下架服务项
export function saleOff(id){
  return request({
   url: '/workflow/serviceItem/saleOff/'+id,
   method: 'put'
  })
 }
